Skip to content

Ris bxdfs example refactor#261

Merged
devshgraphicsprogramming merged 21 commits intomasterfrom
ris_bxdfs
Apr 18, 2026
Merged

Ris bxdfs example refactor#261
devshgraphicsprogramming merged 21 commits intomasterfrom
ris_bxdfs

Conversation

Base automatically changed from sampler-concepts to master April 16, 2026 21:23
vector3_type N = objectID.shapeType == PST_SPHERE ? getSphere(objectID.id).getNormal(intersection.position) : getRectangle(objectID.id).getNormalTimesArea();
N = hlsl::normalize(N);
intersection.geometricNormal = N;
intersection.geometricNormal = ieee754::flipSignIfRHSNegative<vector3_type>(N, hlsl::promote<vector3_type>(-hlsl::dot(N, rayIntersected.direction)));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coould have also been *sign(NdotV) before abs(NdotV)

@@ -27,6 +27,7 @@ using sample_t = bxdf::SLightSample<ray_dir_info_t>;
using iso_cache = bxdf::SIsotropicMicrofacetCache<float>;
using aniso_cache = bxdf::SAnisotropicMicrofacetCache<iso_cache>;
using quotient_pdf_t = sampling::quotient_and_pdf<float32_t3, float>;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mental note, delete

using sample_type = LS;
using spectral_type = Spectrum;
using quotient_pdf_type = sampling::quotient_and_pdf<spectral_type, scalar_type>;
using quotient_weight_type = sampling::quotient_and_pdf<spectral_type, scalar_type>;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it quotient_and_pdf and not quotient_and_weight ?

Comment thread 66_HLSLBxDFTests/tests.h
Comment on lines +42 to +43
typename BxDF::anisocache_type _cache;
s = base_t::bxdf.generate(base_t::anisointer, u.xy, _cache);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this cache, needs to be passed to

Comment thread 66_HLSLBxDFTests/tests.h
Comment on lines +58 to +59
typename BxDF::anisocache_type _cache;
s = base_t::bxdf.generate(base_t::anisointer, u, _cache);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

Comment thread 66_HLSLBxDFTests/tests.h
Comment on lines -288 to +296
s = base_t::bxdf.generate(base_t::anisointer, u.xy);
typename BxDF::anisocache_type _cache;
s = base_t::bxdf.generate(base_t::anisointer, u.xy, _cache);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Comment thread 66_HLSLBxDFTests/tests.h
Comment on lines -205 to +212
pdf = bxdf.pdf(s, isointer);
pdf = bxdf.forwardPdf(s, isointer);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong signature

Comment on lines +77 to +78
typename BxDF::anisocache_type _cache;
sampledLi = base_t::bxdf.quotientAndWeight(s, base_t::isointer, _cache);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dummy cache, not good

Comment thread 31_HLSLPathTracer/app_resources/hlsl/material_system.hlsl
Comment thread 31_HLSLPathTracer/app_resources/hlsl/material_system.hlsl
@devshgraphicsprogramming
Copy link
Copy Markdown
Member Author

devshgraphicsprogramming commented Apr 17, 2026

Self Assigned on material system:

@devshgraphicsprogramming devshgraphicsprogramming merged commit 2065829 into master Apr 18, 2026
@devshgraphicsprogramming devshgraphicsprogramming deleted the ris_bxdfs branch April 18, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants